<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../vue.js"></script>
    <style>
      #app {
        font-family: Avenir, Helvetica, Arial, sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-align: center;
        color: #2c3e50;
      }
    </style>
  </head>

  <body>
    <div id="app">
      <button @click="type=1">新闻</button>
      <button @click="type=2">音乐</button>
      <button @click="type=3">运动</button>

      <div v-show="type===1">
        <h1>新闻</h1>
        <p>内容</p>
      </div>

      <div v-show="type===2">
        <h1>音乐</h1>
        <p>更多音乐</p>
      </div>

      <div v-show="type===3">
        <h1>运动</h1>
        <p>健身</p>
      </div>
    </div>
    <script>
      Vue.config.productionTip = false;
      //实例化Vue
      const vm = new Vue({
        el: "#app",
        data() {
          return {
            type:1
          };
        },
      });
    </script>
  </body>
</html>
